From: Florian Müllner Date: Tue, 29 Jun 2021 18:13:00 +0000 (+0200) Subject: boxpointer: Handle non-widget source actors X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~574^2^2~242 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=16d371873;p=gnome-shell.git boxpointer: Handle non-widget source actors There is no convincing reason why source actors must be widgets, so lift that restriction. Part-of: --- diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index c664ae748..82d28cd83 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -464,8 +464,10 @@ var BoxPointer = GObject.registerClass({ this._workArea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex); // Position correctly relative to the sourceActor - let sourceNode = sourceActor.get_theme_node(); - let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box()); + const sourceAllocation = sourceActor.get_allocation_box(); + const sourceContentBox = sourceActor instanceof St.Widget + ? sourceActor.get_theme_node().get_content_box(sourceAllocation) + : sourceAllocation; let sourceTopLeft = this._sourceExtents.get_top_left(); let sourceBottomRight = this._sourceExtents.get_bottom_right(); let sourceCenterX = sourceTopLeft.x + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;